package com.atguigu01._this;

/**
 * ClassName: PersonTest
 * Package: com.atguigu01._this
 * Description:
 *
 * @Author 姜
 * @Create 2023/11/21 10:38
 * @Version 1.0
 */
public class PersonTest {
    public static void main(String[] args) {
        Person p1 = new Person();
        p1.setAge(10);
        System.out.println(p1.age);
        Person p2 = new Person("坤坤", "kunkun@126.com");
        System.out.println("name = " + p2.name + ", email = " + p2.email);
    }
}

class Person {
    String name;
    int age;
    String email;

    public Person() {
    }

    public Person(String name, String email) {
        this.name = name;
        this.email = email;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return this.age;
    }

    public void eat() {
        System.out.println("红烧肘子");
        this.sleep();
    }

    public void sleep() {
        System.out.println("睡觉啊");
    }
}
